package com.itlong.cloud.commons.resource;

import com.itlong.cloud.POJO.DTO.operate.OperateLoggerDeveloperLogGetPageDTO;
import com.itlong.cloud.POJO.VO.operate.OperateDeveloperLogVO;
import com.itlong.cloud.commons.service.IDeveloperLogService;
import com.itlong.cloud.noncore.operate.IOperateDeveloperLogServiceClient;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      运营-日志管理-开发者日志业务处理暴露接口实现类
 * </desc>
 *
 * @createDate 2018/04/12
 */
@RestController
public class OperateDeveloperLogServiceResource implements IOperateDeveloperLogServiceClient {
    @Autowired
    IDeveloperLogService iDeveloperLogService;

    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO 查询参数DTO
     * @return page模型
     * @author Qiang.S
     * @createDate 2018/12/18
     */
    @Override
    @RequestMapping(path = "/operate/logger/developerLog/getDeveloperLogByPage")
    public Page<OperateDeveloperLogVO> getDeveloperLogByPage(@RequestBody OperateLoggerDeveloperLogGetPageDTO pageDTO) throws Exception{
        return iDeveloperLogService.getDeveloperLogByPage(pageDTO);
    }

    /**
     * <desc>
     *      删除功能
     * </desc>
     *
     * @param logIds 开发者日志id数组
     * @return sql执行行数
     * @author Qiang,S
     * @createDate 2018/12/18
     */
    @Override
    @RequestMapping(path = "/operate/logger/developerLog/delete")
    public Integer delete(@RequestParam("logIds")String logIds){
        return iDeveloperLogService.delete(logIds);
    }
}
